﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;

public partial class AdminCMS_tab_Class_Add : System.Web.UI.Page
{
    #region 成员
    protected string ParentPath = "00";
    #endregion    

    protected void Page_Load(object sender, EventArgs e)
    {
        UIMethod.GetQuery(ref ParentPath, "fullpath", true);

        if (ParentPath == string.Empty) { Response.Redirect("tab_Class_List.aspx"); }
    }

    protected void btn_submit_Click(object sender, EventArgs e)
    {
        DataEntity.tab_Class t = new DataEntity.tab_Class();
        RequestQuery.SetEntityValues(t, form1);
        t.cls_StructId = ParentPath;
        t.cls_NodeValue = DataEntity.tab_Class.GetMaxValue(ParentPath);
        t.Insert();

        GlocalCache.RemoveApplicationData("ProjectNodes");

        StringBuilder sb = new StringBuilder();
        sb.Append("?fullpath=").Append(ParentPath);
        UIMethod.Confirm("添加成功，继续添加吗？", "location = '" + Request.Path + sb.ToString() +
            "';", "location = 'tab_Class_List.aspx" + sb.ToString() + "';");
    }
}
